import jieba
# import jieba.analyse as anls
# seg_list = jieba.cut("再回首恍然如梦，再回首我心依旧", cut_all=True)
# print("【全模式】：" + "/ ".join(seg_list))

# seg_list = jieba.cut("再回首恍然如梦，再回首我心依旧", cut_all=False)
# print("【精确模式】：" + "/ ".join(seg_list))
# print("【返回列表】：{0}".format(seg_list))
# 
# seg_list = jieba.cut_for_search("再回首恍然如梦，再回首我心依旧")
# print("【搜索引擎模式】：" + "/ ".join(seg_list))

# seg_list = jieba.lcut_for_search("再回首恍然如梦，再回首我心依旧")
# print("【返回列表】：{0}".format(seg_list))

# import os

# from os import path
# from wordcloud import WordCloud

# d = path.dirname(__file__) if "__file__" in locals() else os.getcwd()
# text = open(path.join(d, 'job1000.txt'),'rb').read()
# words = jieba.lcut(text)
# cuted=' | '.join(words)
# print(cuted[:100])
# s = "此外，公司拟对全资子公司吉林欧亚置业有限公司增资4.3亿元，增资后，吉林欧亚置业注册资本由7000万元增加到5亿元。吉林欧亚置业主要经营范围为房地产开发及百货零售等业务。目前在建吉林欧亚城市商业综合体项目。2013年，实现营业收入0万元，实现净利润-139.13万元。"
# # for x, w in anls.extract_tags(s, topK=20, withWeight=True):
# #     print('%s %s' % (x, w))

# for x, w in anls.textrank(s, topK=20, withWeight=True, allowPOS=('ns', 'n', 'vn', 'n')):
#     print('%s %s' % (x, w))
result = jieba.tokenize(u'再回首恍然如梦，再回首我心依旧', mode='search')
print("【搜索模式】")
for tk in result:
    print("word: {0} \t\t start: {1} \t\t end: {2}".format(tk[0],tk[1],tk[2]))